package com.cz.nongyetongv5.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 新纪录
 */
public class DuChaXunChaRecord implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * ID 记录的ID
	 */
	private String id;

	/**
	 * 所属区域
	 */
	private Town[] towns = new Town[3];

	/**
	 * 被检单位
	 */
	private BeiJianDanWei beiJianDanWei = null;

	/**
	 * 检查单位
	 */
	private List<JianChaDanWei> jianChaDanWeis = new ArrayList<JianChaDanWei>();

	/**
	 * 检查人员
	 */
	private List<JianChaRenYuan> jianChaReYuans = new ArrayList<JianChaRenYuan>();

	/**
	 * 检查行业
	 */
	private List<JianChaHangYe> jianChaHangYes = new ArrayList<JianChaHangYe>();

	/**
	 * 检查记录
	 */
	private String jianChaJiLu = null;

	/**
	 * 检查结果
	 */
	private JianChaJieGuo[] jianChaJieGuos = new JianChaJieGuo[6];

	/**
	 * 所有的照片信息
	 *
	 */
	private List<Photo> photos = new ArrayList<Photo>();

	/**
	 * 签名路径
	 */
	private String qianMingPath = null;

	private String zhengGaiYiJian;

	/**
	 * 默认情况下为缓存状态
	 */
	private int state = 0;

	/**
	 * 数据生成的时间
	 */
	private String time;

	private String username;

	private String fileId;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public Town[] getTowns() {
		return towns;
	}

	public void setTowns(Town[] towns) {
		this.towns = towns;
	}

	public BeiJianDanWei getBeiJianDanWei() {
		return beiJianDanWei;
	}

	public void setBeiJianDanWei(BeiJianDanWei beiJianDanWei) {
		this.beiJianDanWei = beiJianDanWei;
	}

	public List<JianChaDanWei> getJianChaDanWeis() {
		return jianChaDanWeis;
	}

	public void setJianChaDanWeis(List<JianChaDanWei> jianChaDanWeis) {
		this.jianChaDanWeis = jianChaDanWeis;
	}

	public List<JianChaRenYuan> getJianChaReYuans() {
		return jianChaReYuans;
	}

	public void setJianChaReYuans(List<JianChaRenYuan> jianChaReYuans) {
		this.jianChaReYuans = jianChaReYuans;
	}

	public List<JianChaHangYe> getJianChaHangYes() {
		return jianChaHangYes;
	}

	public void setJianChaHangYes(List<JianChaHangYe> jianChaHangYes) {
		this.jianChaHangYes = jianChaHangYes;
	}

	public List<Photo> getPhotos() {
		return photos;
	}

	/**
	 * 获得上传的photo
	 *
	 * @return
	 */
	public List<Photo> getUploadPhoto() {

		List<Photo> photos = new ArrayList<Photo>();

		if (this.photos != null) {

			for (Photo photo : this.photos) {

				if (photo.isUpload()) {

					photos.add(photo);

				}
			}
		}

		return photos;

	}

	public void setPhotos(List<Photo> photos) {
		this.photos = photos;
	}

	public String getQianMingPath() {
		return qianMingPath;
	}

	public void setQianMingPath(String qianMingPath) {
		this.qianMingPath = qianMingPath;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getZhengGaiYiJian() {
		return zhengGaiYiJian;
	}

	public void setZhengGaiYiJian(String zhengGaiYiJian) {
		this.zhengGaiYiJian = zhengGaiYiJian;
	}

	public Town getKnowTown() {

		if (towns[2] != null) {

			return towns[2];
		}

		if (towns[1] != null) {

			return towns[1];
		}

		if (towns[0] != null) {

			return towns[0];
		}

		return null;

	}

	public String getJianChaJiLu() {
		return jianChaJiLu;
	}

	public void setJianChaJiLu(String jianChaJiLu) {
		this.jianChaJiLu = jianChaJiLu;
	}

	public String getFileId() {
		return fileId;
	}

	public void setFileId(String fileId) {
		this.fileId = fileId;
	}

	public JianChaJieGuo[] getJianChaJieGuos() {
		return jianChaJieGuos;
	}

	public void setJianChaJieGuos(JianChaJieGuo[] jianChaJieGuos) {
		this.jianChaJieGuos = jianChaJieGuos;
	}

}
